﻿using System;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler.SwitchCase;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.Switch
{
	/// <summary>
	/// Switch的Default节点
	/// </summary>
	[TagHandler( typeof( DefaultHandler ) )]
	public class Default : ElementBase
    {
		public override void Initialize ( System.Xml.XmlNode node )
		{
			Switch parent = this.Parent as Switch;
			if ( parent.Default != null )
			{
				throw new Exception ( "Switch节点只能包含一个Default节点！" );
			}
			parent.Default = this;
			base.Initialize ( node );
		}
    }
}
